#! /bin/csh -f
#
set DFTTOPDIR=/usr/adobe/Photoshop_3.0.1
set PNAME=Photoshop_3.0.1

umask 022

# Abort installation if user not superuser
if (`whoami` != root) then
	echo
	echo "You must be logged in as root to install $PNAME."
	echo "Type su and enter the password to become root."
	goto ABORT
endif

BEGIN_SCRIPT:
/usr/bsd/clear

REMOVEAI:
echo
echo "*** Remove an installation of $PNAME ***"

echo ""
echo "Enter the Installation directory into which you"
echo "installed Adobe Photoshop"
echo -n "[press Enter for /usr/adobe]: "
set A = $<
if ( "$A" == ""  ) then
	set TOPDIR="$DFTTOPDIR"
	set OTHERDIR=/usr/adobe
else
	set TOPDIR="${A}/Photoshop_3.0.1"
	set OTHERDIR="${A}"
endif

# Check if installation directory exists
if ( ! -e $TOPDIR ) then
	echo
	echo "$TOPDIR does not exist."
	goto ABORT
endif

echo
echo -n "Removing $TOPDIR ..."
/bin/rm -rf $TOPDIR 
if ( "$TOPDIR" == "$DFTTOPDIR") then
	rmdir /usr/adobe
endif
echo "done"
if ( -d "$OTHERDIR/DPSNXBasic_2.1.1" ) then
echo -n "Remove directory $OTHERDIR/DPSNXBasic_2.1.1 (y/n)? \c"
	set ans=($<)
        if ( $ans != 'y' ) then
	else
	/bin/rm -rf $OTHERDIR/DPSNXBasic_2.1.1
	echo done.
	endif
endif
	if ( -e $OTHERDIR/PPD ) then
	echo -n "Remove directory $OTHERDIR/PPD (y/n)? \c"
	set ans=($<)
        if ( $ans != 'y' ) then
        else
        /bin/rm -rf $OTHERDIR/PPD
	echo done.
	endif
endif
if ( -l /usr/bin/photoshop ) then
echo -n "Remove link /usr/bin/photoshop (y/n)? \c"
set ans=($<)
        if ( $ans != 'y' ) then
            echo " "
                echo " "
                echo "... Bye."
                sleep 3
                exit
	else
	/bin/rm -f /usr/bin/photoshop
	endif
endif
echo "done"
sleep 10
exit 0

ABORT:
exit 1
